#
# Be sure to run `pod lib lint JQKit.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'JQKit'
  s.version          = '0.1.0'
  s.platform         = :ios, "8.0"
  s.summary          = 'iOS开发基础组件库'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
    iOS开发基础组件库，主要包含以下内容：
    1、Shortcut: 通用宏，通用快捷方法
    2、Categories：通用类拓展
    3、Functional：基础控件
                       DESC

  s.homepage         = 'https://gitee.com/zjq_net/JQKit'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'jqz' => 'jquan.zhu@gmail.com' }
  s.source           = { :git => 'https://gitee.com/zjq_net/JQKit.git', :tag => s.version.to_s }

  s.ios.deployment_target = '8.0'
    
  s.public_header_files = "JQKit/JQKit.h"
  s.source_files = "JQKit/JQKit.h"

  # s.resource_bundles = {
  #   'JQKit' => ['JQKit/Assets/*.png']
  # }

  s.frameworks = 'UIKit', 'MapKit'

  # 通用宏定义、快捷方法
  s.subspec 'Shortcut' do |shortcut|
    shortcut.source_files = "JQKit/Shortcut/*.{h,m}"
  end

  # 通用分类
  s.subspec 'Categories' do |categories|
    categories.public_header_files = "JQKit/Categories/Categories.h"
    categories.source_files = "JQKit/Categories/*.{h,m}"

    # Foundation
    categories.subspec 'Foundation' do |foundation|
      foundation.public_header_files = "JQKit/Categories/Foundation/Foundation+Categories.h"
      foundation.source_files = "JQKit/Categories/Foundation/Foundation+Categories.h"

      # NSObject
      foundation.subspec 'NSObject' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSObject/*.{h,m}"
      end

      # NSArray
      foundation.subspec 'NSArray' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSArray/*.{h,m}"
        ss.dependency "JQKit/Categories/Foundation/NSData"
      end

      # NSMutableArray
      foundation.subspec 'NSMutableArray' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSMutableArray/*.{h,m}"
      end

      # NSDictionary
      foundation.subspec 'NSDictionary' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSDictionary/*.{h,m}"
        ss.dependency "JQKit/Categories/Foundation/NSData"
      end

      # NSMutableDictionary
      foundation.subspec 'NSMutableDictionary' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSMutableDictionary/*.{h,m}"
      end

      # NSData
      foundation.subspec 'NSData' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSData/*.{h,m}"
      end

      # NSDate
      foundation.subspec 'NSDate' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSDate/*.{h,m}"
      end

      # NSString
      foundation.subspec 'NSString' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSString/*.{h,m}"
        ss.dependency "JQKit/Categories/Foundation/NSData"
      end

      # NSMutableAttributedString
      foundation.subspec 'NSMutableAttributedString' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSMutableAttributedString/*.{h,m}"
      end

      # NSTimer
      foundation.subspec 'NSTimer' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSTimer/*.{h,m}"
      end

      # NSBundle
      foundation.subspec 'NSBundle' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSBundle/*.{h,m}"
      end

      # NSURL
      foundation.subspec 'NSURL' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSURL/*.{h,m}"
      end

      # NSFileManager
      foundation.subspec 'NSFileManager' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSFileManager/*.{h,m}"
      end

      # NSNotificationCenter
      foundation.subspec 'NSNotificationCenter' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSNotificationCenter/*.{h,m}"
      end

      # NSDictionary
      foundation.subspec 'NSDictionary' do |ss|
        ss.source_files = "JQKit/Categories/Foundation/NSDictionary/*.{h,m}"
      end
    end

    # UIKit
    categories.subspec 'UIKit' do |uikit|
      uikit.public_header_files = 'JQKit/Categories/UIKit/UIKit+Categories.h'
      uikit.source_files = 'JQKit/Categories/UIKit/UIKit+Categories.h'

      # UIView
      uikit.subspec 'UIView' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIView/*.{h,m}"
        ss.dependency "JQKit/Shortcut"
        ss.dependency "JQKit/Categories/Foundation/NSObject"
      end

      # UIScrollView
      uikit.subspec 'UIScrollView' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIScrollView/*.{h,m}"
      end

      # UIButton
      uikit.subspec 'UIButton' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIButton/*.{h,m}"
        ss.dependency "JQKit/Categories/UIKit/UIImage"
      end
      
      # UIControl
      uikit.subspec 'UIControl' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIControl/*.{h,m}"
      end

      # UICollectionViewCell
      uikit.subspec 'UICollectionViewCell' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UICollectionViewCell/*.{h,m}"
      end

      # UIWindow
      uikit.subspec 'UIWindow' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIWindow/*.{h,m}"
      end

      # UIViewController
      uikit.subspec 'UIViewController' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIViewController/*.{h,m}"
        ss.dependency "JQKit/Categories/UIKit/UIView"
        ss.dependency "JQKit/Categories/UIKit/UINavigationController"
        ss.dependency "JQKit/Categories/UIKit/UIBarButtonItem"
      end

      # UINavigationController
      uikit.subspec 'UINavigationController' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UINavigationController/*.{h,m}"
      end

      # UITabBarController
      uikit.subspec 'UITabBarController' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UITabBarController/*.{h,m}"
      end

      # UIColor
      uikit.subspec 'UIColor' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIColor/*.{h,m}"
      end

      # UIImage
      uikit.subspec 'UIImage' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIImage/*.{h,m}"
      end

      # UITextField
      uikit.subspec 'UITextField' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UITextField/*.{h,m}"
      end

      # UITextView
      uikit.subspec 'UITextView' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UITextView/*.{h,m}"
      end

      # UIBarButtonItem
      uikit.subspec 'UIBarButtonItem' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIBarButtonItem/*.{h,m}"
      end

      # UINavigationItem
      uikit.subspec 'UINavigationItem' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UINavigationItem/*.{h,m}"
        ss.dependency "JQKit/Categories/UIKit/UIBarButtonItem"
      end

      # UINavigationBar
      uikit.subspec 'UINavigationBar' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UINavigationBar/*.{h,m}"
      end

      # UIAlertView
      uikit.subspec 'UIAlertView' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIAlertView/*.{h,m}"
      end

      # UIAlertController
      uikit.subspec 'UIAlertController' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIAlertController/*.{h,m}"
        ss.dependency "JQKit/Shortcut"
      end

      # UIImagePickerController
      uikit.subspec 'UIImagePickerController' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIImagePickerController/*.{h,m}"
      end
      
      # UIDevice
      uikit.subspec 'UIDevice' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIDevice/*.{h,m}"
      end

      # UIApplication
      uikit.subspec 'UIApplication' do |ss|
        ss.source_files = "JQKit/Categories/UIKit/UIApplication/*.{h,m}"
        ss.dependency "JQKit/Shortcut"
        ss.dependency "JQKit/Functional/UIUtility"
      end
    end

  end

  # 基础控件
  s.subspec 'Functional' do |founc|
    founc.public_header_files = "JQKit/Functional/Functional.h"
    founc.source_files = "JQKit/Functional/Functional.h"

    # Router
    founc.subspec 'Router' do |ss|
      ss.source_files = "JQKit/Functional/Router/*.{h,m}"
    end
    
    # ActionSheet
    founc.subspec 'ActionSheet' do |ss|
      ss.source_files = "JQKit/Functional/ActionSheet/*.{h,m}"
      ss.dependency "JQKit/Categories/UIKit/UIImage"
      ss.dependency "JQKit/Shortcut"
    end
    
    # UIUtility
    founc.subspec 'UIUtility' do |ss|
      ss.source_files = "JQKit/Functional/UIUtility/*.{h,m}"
      ss.dependency "JQKit/Categories/UIKit/UIAlertView"
      ss.dependency "JQKit/Categories/UIKit/UIWindow"
    end

    # WebViewController
    #founc.subspec 'WebViewController' do |wb|
    #  wb.public_header_files = "JQKit/Functional/WebViewController/WKWebViewController.h"
    #  wb.source_files = "JQKit/Functional/WebViewController/*.{h,m}"
    #end
  end
    
  # s.dependency 'AFNetworking', '~> 2.3'
  #pod lib lint --sources=https://gitee.com/zjq_net/JQSpecs.git,https://github.com/CocoaPods/Specs.git --allow-warnings --use-libraries
  #pod repo push JQSpecs JQKit.podspec --sources=https://gitee.com/zjq_net/JQSpecs.git --allow-warnings --use-libraries

end
